import os
import platform
import sys


# 12降采样函数
def clean_drop(input_file, compression_ratio):
    """

    :param input_file: 输入文件地址
    :param compression_ratio: 压缩比例
    :return: 数组格式输出数据
    """
    if int(compression_ratio) <= 0:
        raise Exception("降采样压缩比例必须为大于0的整数")

    with open(input_file) as file_obj:
        array = eval(file_obj.read())
        after = []
        i = 0
        while i < len(array):
            after.append(array[i])
            i = i + int(compression_ratio)
        return after


if __name__ == '__main__':
    print(clean_drop(sys.argv[1], eval(sys.argv[2])))
